package cn.itcast.service.impl;

import cn.itcast.dao.StudentDao;
import cn.itcast.dao.TeacherDao;
import cn.itcast.domain.Student;
import cn.itcast.domain.Teacher;
import cn.itcast.service.TeacherService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("teacherService")
public class TeacherServiceImpl implements TeacherService {

    @Autowired
    private TeacherDao teacherDao;

    public List<Teacher> findAll() {
        System.out.println("业务层：查询所有账户...");
        return teacherDao.findAll();
    }

    public Teacher findByStuAndPas(@Param("username") String username,
                                   @Param("password") String password){
        return teacherDao.findByStuAndPas(username,password);
    }

    public List<Student> findByAll(@Param("username") String username) {
        return teacherDao.findByAll(username);
    }




}
